<template>
  <div>
    <el-dialog
      title="上次发布审核失败"
      :visible.sync="dialogVisible"
      width="700px"
      :close-on-click-modal="false"
      @close="close"
    >
      <div v-loading="loading" class="dialog-container">
        <el-form ref="form" label-width="120px" size="small">
          <div v-if="detail">
            <el-form-item label="发布版本：">{{ detail.auditVersion.versionNum }}</el-form-item>
            <el-form-item label="发布时间：">{{ detail.auditVersion.updateTime }}</el-form-item>
            <el-form-item label="失败原因：">
              <div style="color:#F56C6C" v-html="detail.auditMsg">{{ detail.auditMsg }}</div>
            </el-form-item>
          </div>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button size="small" :disabled="loading" round @click="hide">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // 配置
      resolve: null,
      reject: null,
      // 状态
      dialogVisible: null,
      loading: false,
      // 数据
      detail: ''
    }
  },
  methods: {
    open(detail) {
      this.detail = detail
      this.show()
      return new Promise((resolve, reject) => {
        this.resolve = resolve
        this.reject = reject
      })
    },
    show() {
      this.dialogVisible = true
    },
    close() {
      this.loading = false
      this.detail = null
      this.resolve = null
      this.reject = null
    },

    hide() {
      this.dialogVisible = false
    }

    /**
       *  按钮组
       */
  }
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
  .dialog-container ::v-deep .el-form-item {
    margin-bottom: 0;
  }
</style>
